package com.xxkk.spring_boot_web.sdk.KBZ.utils;

import java.security.SecureRandom;

public class RandomUtil {
    public static SecureRandom random = new SecureRandom();

    public static String getRandom(int i) {
        StringBuilder sb = new StringBuilder();
        for (int i2 = 0; i2 < i; i2++) {
            if (random.nextInt(2) % 2 == 0) {
                sb.append((char) ((random.nextInt(2) % 2 == 0 ? 65 : 97) + random.nextInt(26)));
            } else {
                sb.append(Integer.toString(random.nextInt(10)));
            }
        }
        return sb.toString();
    }

    public static String getRandomNum(int i) {
        StringBuilder sb = new StringBuilder();
        for (int i2 = 0; i2 < i; i2++) {
            sb.append(Integer.toString(random.nextInt(10)));
        }
        return sb.toString();
    }
}